package com.yl.chainStore.mapper.sick

import com.yl.chainStore.entity.sick.CustomerSubscribeLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.yl.chainStore.pojo.vo.sick.CustomerSubscribeLogSelectVo
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Param

/**
 * <p>
 * 客户预约记录表 Mapper 接口
 * </p>
 *
 * @author cxw
 * @since 2021-08-02
 */
@Mapper
interface CustomerSubscribeLogMapper : BaseMapper<CustomerSubscribeLog> {

	/**
	 * 获取当天客户预约
	 */
	fun getCustomerToDayLog(
		@Param("customerId") customerId: Long,
		@Param("subCompanyId") subCompanyId: Long?
	): List<CustomerSubscribeLog>

	/**
	 * 获取当天客户预约
	 */
	fun getCustomerToDayLogNotHaveRecord(
		@Param("customerId") customerId: Long,
		@Param("subCompanyId") subCompanyId: Long?
	): List<CustomerSubscribeLog>

	/**
	 * 查询列表
	 */
	fun getSubscribeLogList(
		@Param("vo") vo: CustomerSubscribeLogSelectVo
	): MutableList<CustomerSubscribeLog>



	/**
	 * 查询分页
	 */
	fun getSubscribeLogPage(
		@Param("page")page:Page<CustomerSubscribeLog>,
		@Param("vo") vo: CustomerSubscribeLogSelectVo
	): Page<CustomerSubscribeLog>

	/**
	 * 明日预约查询(不包括已取消)
	 */
	fun getSubscribeLogCancelPage(
			@Param("page")page:Page<CustomerSubscribeLog>,
			@Param("vo") vo: CustomerSubscribeLogSelectVo
	): Page<CustomerSubscribeLog>

	/**
	 * 查询数量
	 */
	fun getSubscribeLogCount(
		@Param("vo") vo: CustomerSubscribeLogSelectVo
	): Int

	/**
	 * 查询今日新增预约人数
	 */
	fun getTodayNewSub(@Param("deptId") deptId:Long):Int

	/**
	 * 查询医生今日新增预约人数
	 */
	fun getDoctorTodayNewSub(@Param("doctorId") doctorId:Long):Int

	/**
	 * 查询列表
	 */
	fun getNotHaveRecordDetailSubScribeLog(
		@Param("subCompanyId") subCompanyId: Long
	): MutableList<CustomerSubscribeLog>


}
